document.loading = false;


var html_url = "/html/home.html";
var page_prefix = "/html/home/";

$.ajax({
    url : html_url,
    success : function(response) {
        $("body").html(response);
        core.init();
    }
});

var core = {

    init : function() {
        var page = this.hashToPage[window.location.hash];
        this.show(page);
    },

    show : function(page) {
        window.location.hash = page;
        $.ajax({
            url : page_prefix + page + ".html",
            success : function(response) {
                $("#content").html(response);
            }
        });
    },

    hashToPage : {
        "" : "main",
        "#main" : "main",
        "#objectives" : "objectives",
        "#staff" : "staff",
        "#partners" : "partners",
        "#decks" : "decks",
        "#projects" : "projects",
        "#contact" : "contact",
        "#contribute" : "contribute"
    }

};
